import cv2
import numpy as np

img = cv2.imread('wenzi.jpg')
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
_, th = cv2.threshold(gray, 127, 255,
                     cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)

# 1. 所有外轮廓
cnts, _ = cv2.findContours(th, cv2.RETR_EXTERNAL,
                          cv2.CHAIN_APPROX_SIMPLE)

# 2. 去掉小噪点：只保留面积前4大的
cnts = sorted(cnts, key=cv2.contourArea, reverse=True)[:4]

# 3. 按外接矩形左上角 x 坐标从左到右排序
boxes = [cv2.boundingRect(c) for c in cnts]      # (x,y,w,h)
ordered = sorted(zip(cnts, boxes), key=lambda b: b[1][0])

# 4. 左边第二个就是“东”
dong_cnt = ordered[1][0]

# 5. 画最小外接圆
(x, y), r = cv2.minEnclosingCircle(dong_cnt)
cv2.circle(img, (int(x), int(y)), int(r), (0, 0, 255), 2)

cv2.imshow('dong_circle', img)
cv2.waitKey(0)